<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加系部</title>
    <style>
        .container .kc {
            background-color: #f5f5f5;
        }

        /* .card.col-md-4.ms-3.mt-3:hover{
            background: rgb(241, 240, 240);
        }
        .card.col-md-4.ms-3.mt-3 .mt-1.text-muted:hover,.card.col-md-4.ms-3.mt-3 .card-title:hover{
            color: rgb(97, 172, 172) !important;
        } */
        .link-secondary:hover {
            color: #0d6efd !important;
        }

        .leftmenu {
            min-height: 100vh;
        }
    </style>
</head>

<body>
    <!-- container是bootstrap的居中窄的显示方案 -->
    <div class="container bg-body-secondary">

        <div class="position-fixed bottom-0 end-0">
            <div class="form-control rounded-pill text-primary mb-2"><i class="bi bi-volume-up"></i> 更新公告</div>
            <div class="form-control rounded-pill text-primary mb-2"><i class="bi bi-question-circle-fill"></i> 使用帮助
            </div>
            <div class="form-control rounded-pill text-primary mb-2"><i class="bi bi-person"></i> 在线客服</div>
            <div class="form-control rounded-pill text-primary mb-2"><i class="bi bi-arrow-up-circle-fill"></i> 返回顶部
            </div>
        </div>

        <div class="row">

            <div class="col-md-2 leftmenu" id="leftmenu">
                
            </div>

            <div class="col-md-9 kc ms-3">
                <div class="row mt-3 pb-1 border-bottom border-secondary">
                    <div class="col-md-2">添加系部</div>
                    <div class="col-md-1 offset-md-8">
                        <a class="nav-link link-success" href="javascript:history.back(-1)">返回</a>
                    </div>
                </div>
                <div class="row mt-3">
                    <div class="mb-3 row">
                        <label for="class_code" class="col-sm-2 col-form-label">系部名称:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="class_code">
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label for="class_name" class="col-sm-2 col-form-label">系部编号码:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="class_name">
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label for="class_logo" class="col-sm-2 col-form-label">学校编号码:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="class_logo">
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <div class="col-sm-12">
                            <button type="button" class="btn btn-outline-primary" id="submit">提交</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="module" src="../js/main.js"></script>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/common.js"></script>
    <script>
        $(document).ready(function () {
            $(".btn-outline-primary").click(function () {
                let class_code=$("#class_code").val() //系部名称
                let class_name=$("#class_name").val() //系部编号码
                let class_logo=$("#class_logo").val() //学校编号码

                $.post("http://unicloud.codecore.cn/ms/departCreate",{
                    department_name:class_code,
                    department_code:class_name,
                    school_code:class_logo
                },function (res) {
                    if (res.errCode==0) {
                        location.href="./depart.html"
                    }else{
                        alert("添加失败")
                    }
                })
            })
        })
    </script>
</body>

</html>